﻿//-----------------------------------------------------------------
//
// @(#)$Id: EbayFeeReport.aspx.cs,v 1.0 2013/12/16 9:49:39 lichunhua Exp $
// @(#)$Author: lichunhua  $
// @(#)$Date: 2013/12/16 9:49:39 $
// @(#)$Description:
//
//
//
//                 All Rights Reserved.
//-----------------------------------------------------------------
using System;
using System.Data;
using System.Web.UI.WebControls;
using ebay.Dal;
using ebay.Dal.CenterDB_EbayTableAdapters;

public partial class UI_Report_EbayFeeReport : System.Web.UI.Page
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        //ebayuserid
        T_EbayAccountTableAdapter adapter = new T_EbayAccountTableAdapter();
        ddlebayUserId.DataSource = adapter.GetData();
        ddlebayUserId.DataTextField = "EbayUserId";
        ddlebayUserId.DataBind();
        ddlebayUserId.Items.Insert(0, new ListItem("《--请选择--》", ""));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        WebUtility.CheckRight();
        if (!IsPostBack)
        {
            ebay.Dal.Report rep = new Report();
            DataTable dt = rep.GetEbayFee("");
            this.Repeater1.DataSource = dt;
            this.Repeater1.DataBind();
        }
    }
    //ebayfee统计导出
    protected void btnebayfee_Click(object sender, EventArgs e)
    {
        if (Session["UserId"] == null)
        {
            WebUtility.ShowMsg("登陆超时,请重新登陆", this);
            return;
        }
        ebay.Dal.Report product = new Report();
        DataTable dt = product.GetEbayFee(this .ddlebayUserId .Value );
        dt.TableName = "EbayfeeCount";
        if (dt.Rows.Count > 0)
        {
            DataSetToExcel.DataSetOutExcel(dt, "ebayfee统计表");
        }
        else
        {
            WebUtility.ShowMsg("无数据", this);
        }
    }
    //ebayfee,查询
    protected void btnQuery_Click(object sender, EventArgs e)
    {
        ebay.Dal.Report rep = new Report();
        DataTable dt = rep.GetEbayFee(ddlebayUserId.Value);
        this.Repeater1.DataSource = dt;
        Repeater1.DataBind();
    }
}
